package com.gowinst.test.test;


import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@Controller
public class HelloController {
    @RequestMapping("/hello3")
    @ResponseBody
    public User HelloController() {
        User user=new User();
        user.setAge(32);
        user.setBreithday(new Date());
        user.setUsername("tangyu22");
        user.setPassword("tangyu22");
        return user;
    }
    @RequestMapping("center")
    public String centerController()
    {
        return "thymeleaf/center/center";
    }
    @RequestMapping("/index")
    public String index(ModelMap map) {
        map.addAttribute("name", "freeway?");
        return "thymeleaf/index";
    }

}
